40 std::chrono::time_point<std::chrono::high_resolution_clock>
first_clock_;
41 std::chrono::time_point<std::chrono::high_resolution_clock>
start_clock_;
63 void printProfiling(
const std::string& _tabs, std::ostream& stream = std::cout)
const;
70 std::string
printDuration(
double _duration_microsec,
int precision = 2)
const;
Profiling of a periodic task: number of calls, duration (accumulated, average, max,...
Definition: profiling_unit.h:31
std::chrono::time_point< std::chrono::high_resolution_clock > start_clock_
Time point of the start clock.
Definition: profiling_unit.h:41
double desired_period_us_
Desired period in microseconds (< 0 for not specified)
Definition: profiling_unit.h:34
double getAvgDuration() const
Returns the average duration in seconds.
Definition: profiling_unit.h:143
double getMaxDuration() const
Returns the maximum duration in seconds.
Definition: profiling_unit.h:148
double getStDevDuration() const
Returns the standard deviation of the duration in seconds.
Definition: profiling_unit.h:158
unsigned int getNCallbacks() const
Returns the number of profiled calls.
Definition: profiling_unit.h:118
unsigned int n_callbacks_
Number of callbacks.
Definition: profiling_unit.h:35
double getVarDuration() const
Returns the variance of the duration in seconds squared.
Definition: profiling_unit.h:153
void setDesiredPeriod(double _desired_period_sec)
Sets the desired period in seconds.
Definition: profiling_unit.h:128
double getAccDuration() const
Returns the accumulated duration in seconds.
Definition: profiling_unit.h:138
std::chrono::microseconds max_duration_us_
Maximum duration in microseconds.
Definition: profiling_unit.h:38
ProfilingUnit(double desired_period_sec=-1)
Constructor.
Definition: profiling_unit.cpp:24
double var_duration_us_
Variance of the duration in microseconds squared.
Definition: profiling_unit.h:39
void startProfiling()
Starts the profiling of a call.
Definition: profiling_unit.cpp:35
void printProfiling(const std::string &_tabs, std::ostream &stream=std::cout) const
Prints the profiling results.
Definition: profiling_unit.cpp:107
std::chrono::time_point< std::chrono::high_resolution_clock > first_clock_
Time point of the first clock.
Definition: profiling_unit.h:40
double getAveragePeriod() const
Returns the average period in seconds.
Definition: profiling_unit.h:133
std::chrono::microseconds acc_duration_us_
Accumulated duration in microseconds.
Definition: profiling_unit.h:37
std::string printDuration(double _duration_microsec, int precision=2) const
Returns a string of a duration (in us) in the most appropriate units with the specified precision.
Definition: profiling_unit.cpp:80
void stopProfiling()
Stops the profiling of a call.
Definition: profiling_unit.cpp:44
double getDesiredPeriod() const
Returns the desired period in seconds.
Definition: profiling_unit.h:123
bool running_
True if profiling is running.
Definition: profiling_unit.h:33
bool isRunning() const
Returns whether the profiling of a call is running.
Definition: profiling_unit.h:113
double average_period_us_
Average period in microseconds.
Definition: profiling_unit.h:36
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:617
Definition: capture_base.h:23